#pragma once

#define GLFW_INCLUDE_VULKAN

#include <GLFW/glfw3.h>
#include <string>

namespace njm {

    class NjmWindow
    {
    private:
        void initWindow();
        static void framebufferResizeCallback(GLFWwindow *window, int width, int height);

        int width;
        int height;
        bool framebufferResized = false;

        std::string windowName;
        GLFWwindow *window;

    public:
        NjmWindow(int w, int h, std::string name);
        ~NjmWindow();
        NjmWindow(const NjmWindow&) = delete;
        NjmWindow &operator=(const NjmWindow&) = delete;
        
        bool shouldClose();
        bool wasWindowResized() { return framebufferResized; }
        void resetWindowResizedFlag() { framebufferResized = false; }


        VkExtent2D getExtent() { return {static_cast<uint32_t>(width), static_cast<uint32_t>(height)};}
        std::string getWindowName() { return windowName; }
        GLFWwindow *getGLFWwindow() { return window; }
        
        void createWindowSurface(VkInstance instance, VkSurfaceKHR *surface);
    };
    
}